import { Dialog } from 'antd-mobile'
import React, { FC, JSXElementConstructor, ReactElement, useState } from 'react'
export default function (
  title: string | ReactElement,
  confirm: () => void,
  cancel: () => void,
  confirmText?: string,
  cancelText?: string,
) {
  Dialog.confirm({
    bodyStyle: {
      width: '28rem',
      height: '15.4rem',
      textAlign: 'center',
      paddingTop: '2rem',
    },
    content: (
      <span className=" block relative top-r1.0 text-r1.6 text-gray-333333 font-medium-family font-medium text-center overflow-hidden ">
        {title}
      </span>
    ),
    onConfirm: () => {
      if (confirm) {
        confirm()
      }
    },
    onCancel: () => {
      if (cancel) {
        cancel()
      }
    },
    cancelText: (
      <span className="relative -top-r1.0 shadow-bs2   left-1/2 transform -translate-x-1/2 text-r1.4 leading-r4.0 h-r4.0 w-r11.2 text-gray-333333 font-normal rounded-r2.0  bg-gray-999999 bg-opacity-10 inline-block text-center ">
        {cancelText || '取消'}
      </span>
    ),
    confirmText: (
      <span className="relative -top-r1.0 shadow-bs4   left-1/2 transform -translate-x-1/2 text-r1.4 leading-r4.0 h-r4.0 w-r11.2 text-white rounded-r2.0  bg-gradient-to-r from-orange-FF664F to-orange-FF3627 inline-block text-center ">
        {confirmText || '确定'}
      </span>
    ),
  })
}
